<template>
	<view class="container">
		<view class="form-item">
			<view class="label">租借物品:</view>
			<textarea 
				class="textarea" 
				v-model="formData.item"
				placeholder="请输入要租借的物品及要求等"
			/>
		</view>
		
		<view class="form-item">
			<view class="label">收货地点:</view>
			<input 
				class="input" 
				v-model="formData.address"
				placeholder="教学区-14号楼-666"
			/>
		</view>
		
		<view class="form-item">
			<view class="label">租借时长:</view>
			<input 
				class="input" 
				v-model="formData.duration"
				placeholder="请输入租借时长"
			/>
		</view>
		
		<view class="form-item">
			<view class="label">预计交货时间:</view>
			<input 
				class="input" 
				v-model="formData.deliveryTime"
				placeholder="请输入预计交货时间"
			/>
		</view>
		
		<view class="form-item">
			<view class="label">金额</view>
			<input 
				class="input" 
				type="number" 
				v-model="formData.amount"
				@input="formData.amount = parseFloat(formData.amount) || 0"
			/>
		</view>
		
		<view class="price-section">
			<text>需支付</text>
			<text class="amount">{{ formData.amount }}元</text>
		</view>
		
		<button class="submit-btn" type="primary">立即发布</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				formData: {
					item: '',
					address: '',
					duration: '',
					deliveryTime: '',
					amount: 0
				}
			}
		},
		methods: {
			submitForm() {
				// 表单提交逻辑
				console.log('提交表单:', this.formData)
			}
		}
	}
</script>

<style>
	.container {
		padding: 20rpx;
	}
	.form-item {
		margin-bottom: 20rpx;
	}
	.label {
		font-size: 28rpx;
		margin-bottom: 10rpx;
		color: #333;
	}
	.textarea {
		width: 100%;
		height: 200rpx;
		border: 1rpx solid #ddd;
		border-radius: 8rpx;
		padding: 20rpx;
		box-sizing: border-box;
		background-color: #fff;
	}
	.input {
		width: 100%;
		height: 80rpx;
		border: 1rpx solid #ddd;
		border-radius: 8rpx;
		padding: 0 20rpx;
		box-sizing: border-box;
		background-color: #fff;
	}
	.price-section {
		display: flex;
		justify-content: center;
		align-items: center;
		margin: 30rpx 0;
		font-size: 28rpx;
	}
	.amount {
		color: #f00;
		margin-left: 10rpx;
	}
	.submit-btn {
		width: 90%;
		margin: 40rpx auto;
		background-color: #007AFF;
	}
</style>
